#coding=utf-8
import os
'''
try:
    from flaskext.sqlalchemy import SQLAlchemy
except:
    from flask_sqlalchemy import SQLAlchemy

__ALL__ = ['db', 'DBSession', 'DeclarativeBase', 'metadata']

db = SQLAlchemy()
DBSession = db.session
DeclarativeBase = db.Model
metadata = db.metadata
'''
from sqlalchemy import create_engine
from sqlalchemy.orm import scoped_session, sessionmaker
from sqlalchemy.ext.declarative import declarative_base
import config

engine = create_engine(config.SQLALCHEMY_DATABASE_URI, echo=config.SQLALCHEMY_ECHO)
DBSession = scoped_session(sessionmaker(autocommit=True, autoflush=True, bind=engine))
DeclarativeBase = declarative_base()
metadata = DeclarativeBase.metadata

os.environ["NLS_LANG"] = "american_america.al32utf8"
